var crrorGoods = "维修类型：";

function onload(){
	var arrcolor = dataGet("selcolor").split("|");
	var arrfault = dataGet("selfault").split("|");
	var type_list ="";			
	for(var i=0;i<(arrcolor.length-1);i++){
		type_list +='<li class="list-li">'+dataGet("pname")+arrcolor[i]+'</li>';
		crrorGoods += arrcolor[i] + "|";
	}
	$('#type').html(type_list);
	crrorGoods += "故障列表：";
	var fault_list ="";		
	var pay = 0;
	for(var j=0;j<(arrfault.length-1);j++){
		var fault = arrfault[j].split("=");

		crrorGoods += fault[0] + "|";

		fault_list +='<li class="list-li">'
			+'<span class="li-left">'+fault[0]+'</span>'
			+'<span class="li-right">￥<i>'+fault[1]+'</i>'
			+'</span>'
		+'</li>';
		pay = pay + parseInt(fault[1]);
	}
	$('#fault').html(fault_list);
	$('#pay').html(pay);
}


function sure_pay() {
	var r = confirm("确定购买此商品");
    if (r==false) {
        return;
    }
    layer.open({type: 2});

	var price = $('#pay').html();
	var crrorTel = dataGet("userName");

	var data = "&crrorTel="+crrorTel+"&crrorGoods="+crrorGoods+"&crrorRemarks="+"维修订单"+"&zfFee="+price+"&totalFee="+price
	+"&syScore="+0+"&dkFee="+"0"+"&body="+"商品描述" +"&userUuid="+dataGet("userUuid")+"&openId="+dataGet("openId") +"&attach="+1;
	var url = urlfile + "pay/get/package/weixiu";
	ajaxTool("post",data,url,
		function error(XMLHttpRequest, textStatus, errorThrown,fnErr){
			alert("error:" + data);
		},
		function success(data){
			if(!data.success) {
				alert(data.errMsg);
			}else{
				goToPay(data)
			}
		}
	);
}